package com.qyapp.sdkplatform.wxapi;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.qyapp.sdkplatform.sdk.WechatPlatform;
import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;

public class WXEntryActivity extends Activity implements IWXAPIEventHandler {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {
            WechatPlatform.share().handleIntent(getIntent(),this);
        } catch (Exception e) {
            e.printStackTrace();
        }
        this.finish();
    }


    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        setIntent(intent);
        try {
            WechatPlatform.share().handleIntent(getIntent(), this);
        }catch (Exception e){
            e.printStackTrace();
        }

    }

    @Override
    public void onReq(BaseReq baseReq) {
        Log.d("TAG","onReq");
    }

    @Override
    public void onResp(BaseResp baseResp) {
        Log.d("TAG","onResp");
        WechatPlatform.share().onResp(baseResp);
    }
}